package com.example.back.mapper;

import com.example.common.entity.Module;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface SysModuleMapper {

    @Select("SELECT sm.id_bigint as id,sm.icon_nvarchar as icon,sm.name_nvarchar as name,sm.pid_bigint as pid,sm.show_url_nvarchar as showUrl,sm.sort_int as sort,sm.url_nvarchar as  url,sm.visible_bit as visible FROM sys_module sm INNER JOIN sys_role_modules srm ON(sm.id_bigint=srm.mid_bigint) WHERE srm.rid_bigint=#{rid} AND sm.visible_bit=TRUE order by sm.sort_int ")
    List<Module> queryModByRoleId(@Param("rid") Long rid);

}
